package com.chris.homecare.screens
{
	import com.chris.homecare.components.BreadcrumbComponenet;
	import com.chris.homecare.components.BulletHeadingComp;
	import com.chris.homecare.components.HeaderComponent;
	import com.chris.homecare.data.FetchRemoteData;
	import com.chris.homecare.utils.CommonUtils;
	import com.chris.homecare.utils.ScreenNames;
	
	import feathers.controls.Screen;
	import feathers.controls.ScrollText;
	import feathers.layout.VerticalLayout;
	
	import starling.display.Quad;
	
	public class ServiceDetailScreen extends Screen
	{
		private var headerComp:HeaderComponent;
		private var breadcrumbComp:BreadcrumbComponenet;
		private var bulletHeadingComp:BulletHeadingComp;
		private var scrollText:ScrollText;
		public function ServiceDetailScreen()
		{
			super();
		}
		
		override protected function initialize():void
		{
			CommonUtils.previousScreen = ScreenNames.SERVICES_SCREEN;
			
			var vertLayout:VerticalLayout = new VerticalLayout();
			vertLayout.horizontalAlign = VerticalLayout.HORIZONTAL_ALIGN_CENTER;
			this.layout = vertLayout;
			
			headerComp = new HeaderComponent();
			addChild(headerComp);
			
			breadcrumbComp = new BreadcrumbComponenet("Info", "Our Services");
			addChild(breadcrumbComp);
			
			bulletHeadingComp = new BulletHeadingComp(FetchRemoteData.choosenServiceData.header);
			addChild(bulletHeadingComp);
			
			var gapingQuad:Quad = new Quad(10,20*CommonUtils.scaleValue, 0xFFFFFF);
			addChild(gapingQuad);
			
			scrollText = new ScrollText();
			scrollText.nameList.add("custom-evt-scroll-txt");
			scrollText.text = FetchRemoteData.choosenServiceData.content;
			scrollText.height = 100;
			addChild(scrollText);

			super.initialize();
		}
		
		override protected function draw():void
		{
			scrollText.height = stage.stageHeight - (bulletHeadingComp.y + bulletHeadingComp.height + 40*CommonUtils.scaleValue);
			scrollText.width = stage.stageWidth - 40*CommonUtils.scaleValue;
			super.draw();
		}
	}
}